<!DOCTYPE html>
<html class="ui-page-login">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>注册</title>
	<link href="css/mui.min.css" rel="stylesheet" />
	<link href="css/style.css" rel="stylesheet" />
	<style>
	.area {
		margin: 20px auto 0px auto;
	}
	.mui-input-group:first-child {
		margin-top: 5px;
	}
	.mui-input-group label {
		width:35%;
	}
	.mui-input-row label~input,
	.mui-input-row label~select,
	.mui-input-row label~textarea {
		width: 65%;
	}
	.mui-checkbox input[type=checkbox],
	.mui-radio input[type=radio] {
		top: 6px;
	}
	.mui-content-padded {
		margin-top: 25px;
	}
	.mui-btn {
		padding: 10px;
	}
	.mui-card {
		margin:0 10px;
	}
	.mui-content>.mui-card:first-child {
		margin-top:30px;
	}
	.mui-input-group:last-child{
		margin-bottom:5px;
	}
	.mui-input-group .mui-input-row:after{
		left:0;
	}
	.mui-input-row span{
		color: red;
	}
	</style>
</head>
<body>
	<header id="header"  class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">注册</h1>
	</header>
	<div class="mui-content">
		<div class="mui-card">
		<form class="mui-input-group">
			<div class="mui-input-row">
				<label>用户名<span>*</span></label>
				<input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入用户名">
			</div>
			<div class="mui-input-row">
				<label>密码 <span>*</span></label>
				<input id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入密码">
			</div>
			<div class="mui-input-row">
				<label>姓名 <span>*</span></label>
				<input id='name' type="text" class="mui-input-clear mui-input" placeholder="请输入姓名">
			</div>
			<div class="mui-input-row">
				<label>手机号</label>
				<input id='number' type="number" class="mui-input-clear mui-input" placeholder="请输入手机号">
			</div>
			<div class="mui-input-row">
				<label>邮箱</label>
				<input id='email' type="email" class="mui-input-clear mui-input" placeholder="请输入邮箱">
			</div>
		</form>
		</div>
		<div class="mui-content-padded">
			<button id='reg' class="mui-btn mui-btn-block mui-btn-primary">注册</button>
		</div>
	</div>
	<script src="js/mui.min.js"></script>
	<script src="js/app.js"></script>
	<script>
		(function($, doc) {
			$.init();
			$.plusReady(function() {
				var settings = app.getSettings();
				var regButton = doc.getElementById('reg');
				var accountBox = doc.getElementById('account');
				var passwordBox = doc.getElementById('password');
				var nameBox = doc.getElementById('name');
				var numberBox = doc.getElementById('number');
				var emailBox = doc.getElementById('email');
				regButton.addEventListener('tap', function(event) {
					var regInfo = {
						account: accountBox.value,
						password: passwordBox.value,
						name:nameBox.value,
						number:numberBox.value,
						email: emailBox.value
					};
					app.reg(regInfo, function(err) {
						if (err) {
							plus.nativeUI.toast(err);
							return;
						}
						plus.nativeUI.toast('注册成功');
						$.openWindow({
							url: 'login.html',
							id: 'login',
							show: {
								aniShow: 'pop-in'
							}
						});
					});
				});
			});
		}(mui, document));
	</script>
</body>
</html>